package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.ShopStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController(value = "adminShopController")
@RequestMapping("/admin/shop")
@Slf4j
public class ShopController {
    @Autowired
    private ShopStatusService shopStatusService;
    /**
     * 更改商店启用和禁用
     * @param status
     * @return
     */
    @PutMapping("/{status}")
    public Result updateStatus(@PathVariable Integer status){
        log.info("设置店铺的营业状态为：{}",status);
        return shopStatusService.updateStatus(status);
    }

    /**
     * 得到管理端的状态
     * @return
     */
    @GetMapping("/status")
    public Result getStatus(){
        log.info("客户端得到营业状态：{}");
        return shopStatusService.getStatus();
    }

}
